<template>
	<view class="dk-min-title">
		<view v-if="type === '0'" :style="{ textAlign: align, color: color }">
			<text>{{ title }}</text>
		</view>
		<view v-else style="display: flex; align-items: flex-end; justify-content: space-between">
			<view>
				<text :style="{ color: color }">{{ title }} </text>
				<text style="font-size: 12px; margin-left: 5px" :style="{ color: subColor }">{{ subtitle }} </text>
			</view>
			<view v-if="isMore" :style="{ color: moreColor }" style="font-size: 12px" @click="jump(url)">{{ moreText }}
			</view>
		</view>
	</view>
</template>

<script>
import bus from '../../../utils/bus';
	export default {
		name: 'DkMinTitle',
		props: {
			type: {
				default: '0',
				type: String
			},
			title: {
				default: '',
				type: String
			},
			subtitle: {
				default: '',
				type: String
			},
			align: {
				default: 'left',
				type: String
			},
			color: {
				default: '#000',
				type: String
			},
			subColor: {
				default: '#999',
				type: String
			},
			isMore: {
				default: true,
				type: Boolean
			},
			moreText: {
				default: '查看更多',
				type: String
			},
			url: {
				default: '链接地址',
				type: String
			},
			moreColor: {
				default: '#999',
				type: String
			},
		},
		data() {
			return {}
		},
		computed: {},
		mounted() {
			bus.on('test',(res)=>{
				console.log("res--",res)
			})
		},
		methods: {
			jump(url) {
				if (url) {

					uni.navigateTo({
						url: url
					});
				}
			}
		},
	}
</script>